public class InsertionSort {
    public static void insertionSort(int[] arr){
        for(int i=0;i<arr.length-1;i++){
            int current=arr[i+1];
            int j=i;
            while (j>=0&&current<arr[j]){
                arr[j+1]=arr[j];
                j--;
            }
            arr[j+1]=current;
        }
    }
}
